<template>
  <div class="footer-container" :style="bgStyle">
    <div class="footer-content">
      <!-- 平台简介 -->
      <div class="footer-section platform-intro">
        <div class="logo-container">
          <i class="fas fa-landmark logo-icon"></i>
          <h3 class="platform-title">智銅</h3>
        </div>
        <p class="platform-desc">欢迎莅临古青铜器智能鉴定与学习平台。本平台融合先进科技与悠久文明,致力于揭示青铜器背后的历史智慧与艺术魅力。我们运用尖端人工智能技术,为青铜器研究开启新篇章。</p>
        <p class="platform-desc">无论您是专业研究人员、历史爱好者,还是对中国古代文明怀有好奇心的探索者,这里都将成为您探寻青铜奥秘的理想起点。让我们携手穿越时空,感受先祖智慧,共同书写中华文明新篇章。</p>
      </div>

      <!-- 知识产权声明 -->
      <div class="footer-section copyright-info">
        <h4 class="section-title">版权声明</h4>
        <p class="copyright-text">本平台由智銅团队倾心打造,所有内容均受中华人民共和国法律保护。未经授权,严禁以任何形式使用、复制或传播平台内容。</p>
        <p class="copyright-text">我们欢迎教育工作者和学术研究人员在课堂教学与研究中使用本站资源。若您有相关合作需求，可联系邮箱2295894399@qq.com。</p>
        <p class="copyright-text">@2025智銅团队。保留所有权利。</p>
      </div>

      <!-- 意见反馈 -->
      <div class="footer-section feedback-section">
        <h4 class="section-title">反馈建议</h4>
        <p class="feedback-desc">您的建议是我们进步的动力</p>
        <div class="feedback-form">
          <textarea
            class="feedback-input"
            placeholder="请输入您的意见或建议..."
            v-model="feedbackText"
          ></textarea>
          <button
            class="submit-btn"
            @click="submitFeedback"
          >
            提交反馈
          </button>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import m20 from '@/assets/m20.jpg';
import s1 from '@/assets/s1.jpg';
// import defaultImg from '@/assets/default.jpg';

export default {
  data() {
    return {
      feedbackText: '',
    };
  },
  computed: {
    // 根据当前路由 path，返回对应的 image 模块的 URL
    bgImage() {
      switch (this.$route.path) {
        case '/profile':
          return m20;
        case '/news':
          return s1;
        default:
          return defaultImg;
      }
    },
    // 动态 style，会在路由改变时重新计算
    bgStyle() {
      return {
        backgroundImage: `
          linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)),
          url(${this.bgImage})
        `,
        backgroundRepeat:   'no-repeat',
        backgroundSize:     'cover',
        backgroundPosition: 'center',
        backgroundAttachment: 'fixed',
      };
    },
  },
  methods: {
    submitFeedback() {
      if (!this.feedbackText.trim()) {
        alert('请输入您的反馈内容');
        return;
      }
      alert('感谢您的反馈，我们会认真考虑您的建议！');
      this.feedbackText = '';
    }
  }
};
</script>

<style scoped>
.footer-container {
  /* background: 
    linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), 
    url('@/assets/m20.jpg') no-repeat center/cover fixed; */
  padding: 4rem 0 3rem;
  width: 100%;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 4rem;
}

.footer-section {
  flex: 1;
  padding: 0 1.5rem;
}

.platform-intro {
  max-width: 35%;
}

.logo-container {
  display: flex;
  align-items: center;
  margin-bottom: 2rem;
}

.logo-icon {
  font-size: 2rem;
  color: #D4AF37;
  margin-right: 1rem;
}

.platform-title {
  color: #D4AF37;
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
}

.platform-desc {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #CCCCCC;
}

.section-title {
  color: #D4AF37;
  font-size: 1.5rem;
  margin-bottom: 2rem;
  margin-top: 0%;
  font-weight: 600;
}

.copyright-info {
  max-width: 30%;
}

.copyright-text {
  font-size: 0.9rem;
  color: #CCCCCC;
  margin: 0.5rem 0;
  line-height: 1.4;
}

.feedback-section {
  max-width: 30%;
}

.feedback-desc {
  font-size: 0.9rem;
  color: #CCCCCC;
  margin-bottom: 1rem;
}

.feedback-form {
  display: flex;
  flex-direction: column;
}

.feedback-input {
  background-color: #2A2A2A;
  border: 1px solid rgba(212, 175, 55, 0.5);
  color: #E5E5E5;
  padding: 0.75rem;
  height: 100px;
  margin-bottom: 0.75rem;
  resize: none;
  outline: none;
  transition: border-color 0.3s;
}

.feedback-input:focus {
  border-color: #D4AF37;
  box-shadow: 0 0 5px rgba(212, 175, 55, 0.3);
}

.submit-btn {
  background: linear-gradient(to right, #D4AF37, #AA8A3C);
  color: #1A1A1A;
  font-weight: 600;
  padding: 0.6rem 1.5rem;
  border: none;
  transition: all 0.3s ease;
  align-self: flex-end;
  cursor: pointer;
}

.submit-btn:hover {
  background: linear-gradient(to right, #E5C158, #C09C44);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
  transform: translateY(-2px);
}
</style>